package org.alps.pattern.observer.circle;

/**
 * @date 2021-05-01
 * @author zkw
 */
public class ObserverTest {
    public static void main(String[] args) {
        GpCircle circle = GpCircle.getInstance();

        Teacher teacher = new Teacher("Tom");
        Teacher teacher1 = new Teacher("Mic");

        Question question = new Question();
        question.setUserName("小明");
        question.setContent("观察者设计模式适用于哪些场景？");
        //通知观察者： @老师
        circle.addObserver(teacher);
        circle.addObserver(teacher1);

        circle.publishQuestion(question);


    }
}
